package thread;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

public class SleepDemo2 {
    public static void main(String[] args) {
        Thread kl = new Thread("可莉"){
            public void run(){
                try {
                    System.out.println(getName()+"睡一会");
                    Thread.sleep(10000);
                } catch (InterruptedException e) {
                    System.out.println("是谁！！");;
                }
            }
        };
        Thread dlk =new Thread("迪卢克"){
            public void run(){
                System.out.println("中午去吃饭");
                try {
                    Thread.sleep(8000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println(getName()+"问问可莉吧");
                kl.interrupt();
            }
        };

        kl.start();
        dlk.start();
    }
}
